﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using APluginFramework.Common;

namespace APluginFramework.Core
{
    public abstract class APluginManagerBase:APlugin
    {
        public  void LoadPlugins()
        {
            if (Load())
            {
                if (PluginLoaded != null)
                    PluginLoaded(this, EventArgs.Empty);
            }
            else if (ErrorReport != null)
                ErrorReport(this, EventArgs.Empty);

        }
        protected abstract bool Load();

        public event EventHandler PluginLoaded;
        public event EventHandler ErrorReport;
    }
}
